package com.hci.leukemiaapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class SocialActivity extends Activity {
	
	static final String[] UPDTS = {
        "Jim answered your question", "Sally posted a new question"};

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
	    setContentView(R.layout.social);
	    
	    Button askButton = (Button) findViewById(R.id.askq);

        askButton.setOnClickListener(new View.OnClickListener() {

            public void onClick(View view) {
            	askAQuestion();
            }
        });
	}
    
    private void askAQuestion() {
    	Intent i = new Intent(this, SocialQuestion.class);
        startActivityForResult(i, 0);
	}
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
        super.onActivityResult(requestCode, resultCode, intent);
        if(resultCode==RESULT_OK) {
        	Toast.makeText(this, 
                    "Question Posted", 
                    Toast.LENGTH_SHORT).show();
        }
    }

}